Package edu.uky.ai.lp

Class Result

java.lang.Object
edu.uky.ai.lp.Result

public class Result
extends java.lang.Object
Describes the result of a single action taken by the player, including any new information gained.
Author:
Stephen G. Ware
  • Field Summary

    Fields 
    Modifier and Type Field Description
    boolean breeze
    Indicates if the square the player just moved to has a breeze
    static Result EAT
    A special result indicating that the player was eaten by the wumpus
    static Result FALL
    A special result indicating that the player fell into a pit
    boolean glitter
    Indicates if the square the player just moved to glitters
    static Result GRAB
    A special result indicating that the player picked up the gold
    static Result NOTHING
    A special result indicating that the player's action has no effect on the game state
    boolean stench
    Indicates if the square the player just moved to has a stench
    static Result WIN
    A special result indicating that the player won
  • Constructor Summary

    Constructors 
    Constructor Description
    Result​(boolean stench, boolean breeze, boolean glitter)
    Creates a result which indicates sensory information about the square the player just moved to.
    Result​(java.lang.String message)
    Creates a result which displayed a special message.
  • Method Summary

    Modifier and Type Method Description
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • stench

      public final boolean stench
      Indicates if the square the player just moved to has a stench
    • breeze

      public final boolean breeze
      Indicates if the square the player just moved to has a breeze
    • glitter

      public final boolean glitter
      Indicates if the square the player just moved to glitters
    • NOTHING

      public static final Result NOTHING
      A special result indicating that the player's action has no effect on the game state
    • GRAB

      public static final Result GRAB
      A special result indicating that the player picked up the gold
    • WIN

      public static final Result WIN
      A special result indicating that the player won
    • EAT

      public static final Result EAT
      A special result indicating that the player was eaten by the wumpus
    • FALL

      public static final Result FALL
      A special result indicating that the player fell into a pit
  • Constructor Details

    • Result

      public Result​(boolean stench, boolean breeze, boolean glitter)
      Creates a result which indicates sensory information about the square the player just moved to.
      Parameters:
      stench - indicates if the square the player just moved to has a stench
      breeze - indicates if the square the player just moved to has a breeze
      glitter - indicates if the square the player just moved to glitters
    • Result

      public Result​(java.lang.String message)
      Creates a result which displayed a special message.
      Parameters:
      message - the message to display
  • Method Details

    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object